Skip to content

Make interface for BatteryPool metrics consistent with power methods - #381

Merged
shsms merged 4 commits into
frequenz-floss:v0.x.xfrom
sahas-subramanian-frequenz:battery-pool-metrics
May 25, 2023
Merged

Make interface for BatteryPool metrics consistent with power methods#381
shsms merged 4 commits into
frequenz-floss:v0.x.xfrom
sahas-subramanian-frequenz:battery-pool-metrics

Conversation

@sahas-subramanian-frequenz

Copy link
Copy Markdown
Contributor

The soc, capacity, power_bounds methods of the BatteryPool
were directly returning receivers. They've now been converted to
properties, from which new_receiver() has to be called, to get a
receiver.

New:

soc_recv = battery_pool.soc.new_receiver()

Old:

soc_recv = battery_pool.soc()

@sahas-subramanian-frequenz
sahas-subramanian-frequenz requested a review from a team as a code owner May 8, 2023 15:52
@github-actions github-actions Bot added part:data-pipeline Affects the data pipeline part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests labels May 8, 2023
Marenz
Marenz previously approved these changes May 12, 2023
@Marenz

Marenz commented May 12, 2023

Copy link
Copy Markdown
Contributor

Merging is blocked
The base branch requires all commits to be signed.

@shsms

shsms commented May 15, 2023

Copy link
Copy Markdown
Contributor

commits are now signed, also added a release notes entry.

@shsms shsms self-assigned this May 15, 2023
@shsms shsms added this to the v0.21.0 milestone May 15, 2023
Comment thread RELEASE_NOTES.md Outdated

* `BatteryPool` metric streaming interfaces have changed for `soc`, `capacity` and `power_bounds`:

``` python

@Marenz Marenz May 17, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax should be ```python

And this makes me realize that we aren't testing the RELEASE_NOTES examples yet

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leandro-lucarella-frequenz do we want to test that? If so this example would fail of course

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmm, not sure about RELEASE_NOTES, sometimes we want to use old syntax/features to show an upgrade path, I would leave it outside.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that could be solved by either commenting the wold syntax/way or by having an extra ``` wrapped block that is not marked as python

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the extra space.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that adds more noise than it helps. Examples in the RELEASE NOTES are a one-off thing, if you checked the time you write them, then they don't need to be kept up to date ever again. I really think that would make writing release notes more annoying and harder to read with very little gain.

Comment thread RELEASE_NOTES.md
shsms and others added 4 commits May 25, 2023 12:12
Signed-off-by: Sahas Subramanian <sahas.subramanian@frequenz.com>
Signed-off-by: Sahas Subramanian <sahas.subramanian@frequenz.com>
This makes their interface to be more consistent with the power and
current methods.

    soc_recv = battery_pool.soc.new_receiver()

instead of:

    soc_recv = battery_pool.soc()

Signed-off-by: Sahas Subramanian <sahas.subramanian@frequenz.com>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
@shsms
shsms force-pushed the battery-pool-metrics branch from 97470e7 to 7e77a18 Compare May 25, 2023 10:15
@shsms

shsms commented May 25, 2023

Copy link
Copy Markdown
Contributor

Rebased, resolved conflicts.

Comment thread examples/battery_pool.py
@shsms
shsms added this pull request to the merge queue May 25, 2023
Merged via the queue into frequenz-floss:v0.x.x with commit 23ff30c May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:data-pipeline Affects the data pipeline part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

Development

Successfully merging this pull request may close these issues.

4 participants